<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>新增菜单</title>
    <link rel="stylesheet" href="/plugins/layui/css/layui.css" media="all">
    <script src="/plugins/layui/layui.js"></script>
    <script src="/common/js/common.js"></script>
    <script src="/plugins/jquery/jquery.min.js?v=1.12.4"></script>
    <script src="/common/js/my-jquery.js?v=1.0.0"></script>
</head>
<body>
<include src=""></include>
<!--<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>角色>增加</legend>
</fieldset>-->

<form class="layui-form" action="" style="margin-top: 20px;" id="form">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-inline">
                <input type="login" name="name" lay-verify="required" autocomplete="off" class="layui-input"
                       placeholder="名称">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">编号</label>
            <div class="layui-input-inline">
                <input type="text" name="code" lay-verify="required" autocomplete="off" class="layui-input"
                       placeholder="编号">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">url</label>
            <div class="layui-input-inline">
                <input type="text" name="url" lay-verify="required" autocomplete="off" class="layui-input"
                       placeholder="url">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">父级id</label>
            <div class="layui-input-inline">
                <input type="type" name="parentId" lay-verify="required" autocomplete="off" class="layui-input" value="${(parentId)!''}"
                       placeholder="父级id">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-inline">
                <input type="type" name="sort" lay-verify="required" autocomplete="off" class="layui-input"
                       placeholder="排序" value="0">
            </div>
        </div>
    </div>
    <div class="layui-form-item" style="position:absolute;left:20px;bottom:0px;">
        <button class="layui-btn layui-btn-danger" type="button" lay-submit lay-filter="form" id="submit">保存</button>
        <button class="layui-btn layui-btn-normal" type="button" id="cancel">取消</button>
    </div>
</form>
<script>
    layui.use(['form', 'jquery'], function () {
        var $ = layui.$
        var url = '/menu/add.json';
        console.log($("#form").serializeJson())
        Common.addOrUpdateData(url, "#form", "#submit");
        $("#cancel").click(function () {
            Common.closeFrame();
        })
    })
</script>
</body>
</html>
